﻿using ebcpatterns.concurrent;
using ebcpatterns.flow;
using StructureMap;
using StructureMap.Configuration.DSL;

namespace app
{
    internal class EbcPatternsRegistry : Registry
    {
        public EbcPatternsRegistry() {
            For(typeof(IJoin<,,>)).Use(typeof(Join<,,>));
            For(typeof(IJoin<,>)).Use(typeof(Join<,>));
            For(typeof(IMap<,>)).Use(typeof(Map<,>));
            For(typeof(IMap<>)).Use(typeof(Map<>));

            For(typeof(IThrottle<>)).Use(typeof(Throttle<>)).CtorDependency<int>("periodInMilliseconds").Is(500);
            For(typeof(IAsynchronizer)).Use(typeof(Asynchronizer));
            For(typeof(IAsynchronizer<>)).Use(typeof(Asynchronizer<>));
        }
    }
}